﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace Data
{
     public class Themnsx_Data:NhasxInfor
    {
        protected static string _connectString;
        protected SqlConnection Cnn;
        protected SqlCommand cmd;

        public static string ConnectionString
        {
            get { return _connectString; }
            set { _connectString = value; }
        }

        public void connect()
        {
            Cnn = new SqlConnection(ConnectionString);
            Cnn.Open();
        }

        public void Disconnect()
        {
            Cnn.Close();
        }
        private NhasxInfor _nhasx;
        public NhasxInfor nhasx
        {
            get { return _nhasx; }
            set { _nhasx = value; }
        }
        public void ThemNSX(string mansx,string tennsx)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = Cnn;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "NhaSX_Insert";
            cmd.Parameters.Add("@MaNSX", SqlDbType.VarChar).Value = nhasx;
            cmd.Parameters.Add("@TenNSX", SqlDbType.NVarChar).Value =nhasx;
            cmd.ExecuteNonQuery();
        }
    }
}
